package com.glamour.hlcity.component.framework.factory;

import com.glamour.hlcity.component.framework.common.NotifyEnum;
import com.glamour.hlcity.component.framework.common.NotifyObject;
import com.glamour.hlcity.component.framework.obse.GenObservable;
import com.glamour.hlcity.component.framework.registry.impl.ApplicationContextFactory;
/**
 * 提醒操作句柄
 * @author zhaoxing.liuzx
 *
 */
public class NotifyHandler {
	private final static String BEAN_NAME="genObservable";
	
	/**
	 * 提醒
	 * @param notifyEnum
	 * @param obj
	 */
	public static void notify(NotifyEnum notifyEnum,NotifyObject obj){
		if(obj==null){
			return;
		}
		//设置值
		obj.setNotifyEnum(notifyEnum);
		GenObservable observable=(GenObservable) ApplicationContextFactory.getBean(BEAN_NAME);
		//加载监听者
		observable.addObservers();
		try{
			//开始banding事件
			observable.fireEvent(notifyEnum, obj);
		}catch(Exception e){
			
		}
		
	}

}
